Here's another oddity with the way that DOORS handles the change of edit mode...
bool closeDialogOnModuleClose(Trigger t) {
closeDB(example_DB);
return(true);
}
However, for some reason, if you downgrade from Exclusive or Shareable to Read, the trigger fires and the Dialog Box is closed!
bool closeDialogOnModuleClose(Trigger t) {
if (module(t) != null) return(true);
closeDB(example_DB);
return(true);
}
SystemAdmin - Tue Jan 08 07:03:23 EST 2013 |
Re: Changing module to Read-Only fires "Module Close" trigger For a pre-close trigger (which you have in your example), I would have thought that the module(t) is indeed still open (since the trigger fires before the module closes) and thus your modification would never close the dialog, even when you want it to. If your code works (when you actually "close") then I wonder what is wrong with my thinking here. -Louie |
Re: Changing module to Read-Only fires "Module Close" trigger llandale - Tue Jan 08 09:40:42 EST 2013 I changed the trigger callback function to a void function, thus changing it into a post-close trigger, and it works as expected. Thanks for the thoughts Louie |
Re: Changing module to Read-Only fires "Module Close" trigger SystemAdmin - Tue Jan 08 10:15:33 EST 2013 So, the final way I catered for this scenario is to:
void closeDialogOnModuleClose(Trigger t)
{
Module modTrg = module(t)
if (null(modTrg))
{
closeDB(example_DB)
return
}
if (isVisible(modTrg)) return
closeDB(example_DB)
return
}
|
Re: Changing module to Read-Only fires "Module Close" trigger SystemAdmin - Tue Jan 08 11:28:56 EST 2013 So, the final way I catered for this scenario is to:
void closeDialogOnModuleClose(Trigger t)
{
Module modTrg = module(t)
if (null(modTrg))
{
closeDB(example_DB)
return
}
if (isVisible(modTrg)) return
closeDB(example_DB)
return
}
Otherwise if you close the dialog and then close the module, the trigger will fire and attempt to access an invalid DB handle. -Louie |